package h0709;

import java.util.*;
import java.util.function.Function;
/**
  * @description 查找接口成功率最优秀时间段
  * @author 不知名帅哥
  * @date 2024/7/12 22:47
  * @version 1.0
*/
public class SearchInterfaceSuccessMaxfitTime {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int minAverageLost = Integer.parseInt(sc.nextLine());
        int[] nums = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();

        List<String> result = getResult(minAverageLost, nums);
        StringJoiner joiner=new StringJoiner(" ");
        for (String s : result) {
            joiner.add(s);
        }
        System.out.println(joiner);

    }

    private static List<String> getResult(int min, int[] nums) {
        int n = nums.length;
        //最优解，最大长度区间
        int maxLength = 0;
        List<String> result = new ArrayList<>();

        for (int start = 0; start < n; start++) {
            int sum = 0;
            for (int end = start; end < n; end++) {
                //求和
                sum += nums[end];
                int length = end - start + 1;
                double average = (double) sum / length;

                //滑动窗口，双层for循环，如果当前length大于maxlength,则更新result，并且将maxlength更新。
                //注意要将result重新设置为null，因为最后的结果只是取区间最长的最优解，要么只有一个最优解，要么几个长度相同的最优解。
                if (average <= min) {
                    if (length > maxLength) {
                        result = new ArrayList<>();
                        maxLength=length;
                        result.add(start + "-" + end);
                    } else if (length==maxLength){
                        result.add(start + "-" + end);
                    }
                }
            }
        }
        return result;
    }
}
